<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<script type="text/javascript">
		function clickme() {
			document.getElementById("form:loginLink").click();
		}
	</script>
</h:head>
<h:body onload="clickme();">
	<h:form id="form">
		<h:outputLink id="loginLink" value="javascript:void(0)"
			onclick="dlg.show()" title="">
		</h:outputLink>
		<p:growl id="growl" showDetail="true" life="10000" />

		<p:dialog id="dialog" header="Login" widgetVar="dlg" resizable="false"
			closable="false">

			<h:panelGrid columns="2" cellpadding="5">
				<h:outputLabel value="#{bundle.loginUserName}" />
				<h:inputText value="#{loginMB.email}" label="Email" id="email"
					required="true">
					<f:validateLength minimum="5" />
				</h:inputText>
				<h:outputLabel value="#{bundle.loginPassword}" />

				<h:inputSecret value="#{loginMB.password}" label="Password"
					id="senha" required="true" autocomplete="off">
					<f:validateLength minimum="5" />
				</h:inputSecret>

				<f:facet name="footer">
					<p:commandButton action="#{loginMB.login}" value="Log in"
						ajax="false" />
				</f:facet>
			</h:panelGrid>

		</p:dialog>
	</h:form>
</h:body>
</html>

